﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace ProjScan.GUIExtensions
{
	// Token: 0x0200031E RID: 798
	public class GUITableState
	{
		// Token: 0x060012B8 RID: 4792 RVA: 0x00008CA7 File Offset: 0x00006EA7
		public GUITableState()
		{
		}

		// Token: 0x060012B9 RID: 4793 RVA: 0x00059438 File Offset: 0x00057638
		public GUITableState(string prefsKey)
		{
			this.prefsKey = prefsKey;
			GUITableState guitableState = GUITableState.Load(prefsKey);
			this.scrollPos = guitableState.scrollPos;
			this.scrollPosHoriz = guitableState.scrollPosHoriz;
			this.sortByColumnIndex = guitableState.sortByColumnIndex;
			this.sortIncreasing = guitableState.sortIncreasing;
			this.columnSizes = guitableState.columnSizes;
			this.columnVisible = guitableState.columnVisible;
		}

		// Token: 0x060012BA RID: 4794 RVA: 0x000594C0 File Offset: 0x000576C0
		public void Save()
		{
			bool flag = !string.IsNullOrEmpty(this.prefsKey);
			if (flag)
			{
				ProjectSpecificEditorPrefs.SetString(this.prefsKey, JsonUtility.ToJson(this));
			}
		}

		// Token: 0x060012BB RID: 4795 RVA: 0x000594F4 File Offset: 0x000576F4
		public static GUITableState Load(string prefsKey)
		{
			bool flag = ProjectSpecificEditorPrefs.HasKey(prefsKey);
			GUITableState result;
			if (flag)
			{
				result = JsonUtility.FromJson<GUITableState>(ProjectSpecificEditorPrefs.GetString(prefsKey, string.Empty));
			}
			else
			{
				result = new GUITableState();
			}
			return result;
		}

		// Token: 0x04000B13 RID: 2835
		public Vector2 scrollPos;

		// Token: 0x04000B14 RID: 2836
		public Vector2 scrollPosHoriz;

		// Token: 0x04000B15 RID: 2837
		public int sortByColumnIndex = -1;

		// Token: 0x04000B16 RID: 2838
		public bool sortIncreasing;

		// Token: 0x04000B17 RID: 2839
		public List<float> columnSizes = new List<float>();

		// Token: 0x04000B18 RID: 2840
		public List<bool> columnVisible = new List<bool>();

		// Token: 0x04000B19 RID: 2841
		private string prefsKey;
	}
}
